home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / gfx / show / gs_src_gs.lha / gs5.03 / stat_.h < prev    next >
C/C++ Source or Header  |  1997-07-21  |  2KB  |  47 lines

  1. /* Copyright (C) 1991, 1995, 1997 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* stat_.h */
  20. /* Generic substitute for Unix sys/stat.h */
  21.  
  22. /* We must include std.h before any file that includes sys/types.h. */
  23. #include "std.h"
  24. #include <sys/stat.h>
  25.  
  26. /* Many environments, including the MS-DOS compilers, don't define */
  27. /* the st_blocks member of a stat structure. */
  28. #if defined(__SVR3) || defined(__EMX__) || defined(__DVX__) || defined(OSK) || defined(__MSDOS__) || defined(__QNX__) || defined(VMS) || defined(__WIN32__) || defined(__IBMC__) || defined(__BEOS__)
  29. #  define stat_blocks(psbuf) (((psbuf)->st_size + 1023) >> 10)
  30. #else
  31. #  define stat_blocks(psbuf) ((psbuf)->st_blocks)
  32. #endif
  33.  
  34. /* Microsoft C uses _stat instead of stat, */
  35. /* for both the function name and the structure name. */
  36. #ifdef _MSC_VER
  37. #  define stat _stat
  38. #endif
  39.  
  40. /* Some (System V?) systems test for directories */
  41. /* in a slightly different way. */
  42. #if defined(OSK) || !defined(S_ISDIR)
  43. #  define stat_is_dir(stbuf) ((stbuf).st_mode & S_IFDIR)
  44. #else
  45. #  define stat_is_dir(stbuf) S_ISDIR((stbuf).st_mode)
  46. #endif
  47.